<template>
    <div class="tuan">

        <!-- 上新预告-->
        <div class="goods" v-for="(item,index) in goods" :key="index">
            <div class="imgBox">
                <img :src="item.picture" alt="">
            </div>
            <div class="infor">
                <span class="name">{{item.name}}</span>
                <div class="price">
                    <span>￥{{item.min_price}}</span>
                    <button @click="change">{{go?'马上抢':'已抢'}}</button>
                </div>
                <div class="count">{{item.month_saled_content}}</div>
            </div>
        </div>
    </div>
</template>

<script>
import {tuan_list} from "../utils/api";
export default {
    data(){
        return{
            go:true,
            goods:[]
        }
    },
    mounted(){
        tuan_list( {status:1} ).then(res=>{
            console.log(res.data);
            this.goods = res.data.list; 
        })
    },
    methods:{
        change(){
            this.go=!this.go;
        }
    }
}
</script>

<style lang="scss" scoped>

.goods{
    margin: 10px;
    border-radius: 20px;
    background: white;
    overflow: hidden;
    display: flex;
}
.goods .imgBox{
    width: 80px;
    height: 80px;
    margin: 10px;
}
.goods .imgBox img{
    width: 100%;
    height: 100%;
    border-radius: 5px;
}
.goods .infor{
    flex: 1;
    margin: 10px;
}
.goods .infor .name{
    font-weight: bold;
    margin: 10px 0;
}
.goods .infor .price{
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.goods .infor .price span{
    font-size: 20px;
    margin: 10px 0;
    color:orangered;
}
.goods .infor .price button{
    height: 30px;
    width: 60px;
    border-radius: 10px;
    background: orangered;
    color: white;
    outline: none;
    border: none;
}
.goods .infor .count{
    float: right;
    margin: 10px;
}
</style>